Chapter 23
Upgrading From
Lasso Professional 5

[p]This chapter contains important information for users of Lasso Professional 5 who are upgrading to Lasso Professional 8. Please read through this chapter before attempting to run solutions in Lasso Professional 8 that were originally developed for an earlier version of Lasso. [/p]

[p]The upgrading chapters are cumulative so this chapter should be read in conjunction with the preceding chapters for full information about changes to Lasso. [/p]

[p]Topics in this chapter include: [/p]

Introduction

[p]This chapter includes the upgrading instructions from Lasso Professional 5 to Lasso Professional 8. If a site is being upgraded from Lasso Professional 5 the items in this chapter should be applied first, followed by the items in the prior chapter about upgrading from Lasso Professional 6, and then the items in the chapter about upgrading from Lasso Professional 7. [/p]

Lasso Studio and Lasso Updater

[p]Lasso Studio includes a Lasso Updater that can be used on code from earlier versions of Lasso to bring it into compliance with the latest version of Lasso. See the documentation for Lasso Studio for more information. [/p]

Tag Name Changes

[p]All tags from Lasso Professional 5 are supported in Lasso Professional 8 except for those listed in the table below. There are also a number of tag names which have changed or been deprecated in favor of new tags or methodologies in Lasso Professional 8. [/p]

[p]The following table lists tags that are not supported in Lasso Professional 8. These tags must be replaced in order for sites to work properly in Lasso Professional 8. [/p]

Table 1: Unsupported Tags

[table][tr][th]Lasso 5 Tag[/th][th]Lasso 8 Tag Equivalent[/th][th] [/th][/tr]

[tr][td][Encode_MacToISO][/td][td][Bytes->ExportString] [/td][/tr]

[tr][td][Encode_ISOtoMac][/td][td][Bytes->ExportString] [/td][/tr]

[/table]

[p]The following table lists the tag names that have been changed in Lasso Professional 8 since the release of Lasso Professional 5. The old versions of each tag will continue to work, but their use has been deprecated. Any new development in Lasso Professional 8 should use the new versions of the tag names. [/p]

Table 2: Tag Name Changes

[table][tr][th]Lasso 5 Tag[/th][th]Lasso 8 Tag Equivalent[/th][th] [/th][/tr]

[tr][td][Null->Up][/td][td][Null->Parent] [/td][/tr]

[tr][td][String->Length][/td][td][String->Size] [/td][/tr]

[/table]

[p]The following table lists the tags from Lasso Professional 5 which have been deprecated in Lasso Professional 8 and what code equivalent should be used. The deprecated versions of these tags will continue to work, but any new development in Lasso Professional 8 should use the suggested code equivalent rather than the deprecated tags. [/p]

Table 3: Deprecated Tags

[table][tr][th]Lasso 5 Tag[/th][th]Lasso 8 Tag Equivalent[/th][th] [/th][/tr]

[tr][td][Date_GetCurrentDate][/td][td][Date] [/td][/tr]

[tr][td][Date_GetDay][/td][td][Date->Day] [/td][/tr]

[tr][td][Date_GetDayOfWeek][/td][td][Date->DayOfWeek] [/td][/tr]

[tr][td][Date_GetHour][/td][td][Date->Hour] [/td][/tr]

[tr][td][Date_GetMinute][/td][td][Date->Minute] [/td][/tr]

[tr][td][Date_GetMonth][/td][td][Date->Month] [/td][/tr]

[tr][td][Date_GetSecond][/td][td][Date->Second] [/td][/tr]

[tr][td][Date_GetYear][/td][td][Date->Year] [/td][/tr]

[tr][td][Error_NoRecordsFound][/td][td]Check for whether [Found_Count] is zero. [/td][/tr]

[tr][td][PostCondition][/td][td]-ReturnType in [Define_Tag] [/td][/tr]

[tr][td][PreCondition][/td][td]-Type or -Criteria in [Define_Tag] [/td][/tr]

[tr][td][Repetition][/td][td]Modulus Symbol % [/td][/tr]

[tr][td][TCP_Close][/td][td][Net->Close] [/td][/tr]

[tr][td][TCP_Open][/td][td][Net->Connect] [/td][/tr]

[tr][td][TCP_Send][/td][td][Net->Read], [Net->Write] [/td][/tr]

[/table]

Syntax Changes

[p]Lasso Professional 7 introduces changes to some of the core syntax rules of Lasso. Most of these changes were made to improve the reliability and error reporting of Lasso. Some of these changes may require you to rewrite portions of your existing Lasso-based solutions for full compatibility with Lasso Professional 8. This section describes each change, why it was made and how to update existing Lasso pages. [/p]

Table 4: Syntax Changes

[table][tr][th]Syntax Change[/th][th]Description[/th][th] [/th][/tr]

[tr][td]No Process Tags[/td][td]New [NoProcess] … [/NoProcess] tags allow a portion of a page to be passed to the browser without being processed. [/td][/tr]

[tr][td]Strict Syntax[/td][td]A strict syntax option allows errors such as non-hyphenated parameters, non-quoted variables, and undefined tags to be reported as syntax errors. [/td][/tr]

[tr][td]Date Data Type[/td][td]Date operations have been converted to a new date data type. Lasso 5 date tags have some modifications. [/td][/tr]

[tr][td]Integer Rounding[/td][td]The [Integer] tag now rounds to the nearest integer instead of truncating. [/td][/tr]

[tr][td]No Records Found[/td][td]The [Error_NoRecordsFound] tag has been deprecated. Check whether [Found_Count] equals zero instead. [/td][/tr]

[/table]

No Process Tags

[p]Lasso Professional 8 includes a container tag [code][NoProcess] … [/NoProcess][/code] that instructs the Lasso parser to ignore its contents. This allows code from other programming languages to be passed through to the browser without any processing by Lasso. These new tags do not require any changes to existing Lasso Web sites, but may make transitioning from older versions of Lasso easier. [/p]

[p]The[code] [NoProcess] … [/NoProcess][/code] tags must be embedded in a page exactly as written with no extra spaces or parameters within the square brackets. They cannot be used within LassoScript. [/p]

To instruct Lasso to ignore a portion of a page:

[p]Use the [code][NoProcess] … [/NoProcess] [/code]tags. In the following example, the entire contents of a JavaScript code block is ignored by Lasso. Any array references within the JavaScript will not be interpreted by Lasso as square bracketed tags. [/p]

[pre][NoProcess]
<script language="JavaScript">
… JavaScript Expressions …
</script>
[/NoProcess] [/pre]

Strict Syntax

[p]With strict syntax the following rules are enforced: [/p]

[p]With strict syntax any of the errors above will be reported when a page is first loaded. They must be corrected before the code on the page will be executed. When upgrading to Lasso Professional 8 it is advisable to first try existing Lasso Professional 5 sites and correct any errors that are reported. [/p]

To update existing sites for strict syntax:

[p]If a site is relatively small then the easiest method is to load each Web page and see if any errors are reported. The following tips can be used for a more methodical search. [/p]

[pre][String: '[array[4]]'] [/pre]

[pre] [array[4]] [/pre]

Date Data Type

[p]The date tags from Lasso 5 have been replaced by new date and duration data types in Lasso 7. This change should not require any changes to existing code, but many Lasso 5 tags have been deprecated and many other operations are significantly easier using the new tags. See the Date and Time Operations chapter for full documentation of the new date and duration data types. [/p]

[p]Some highlights of the new date and duration data types include: [/p]

Integer Rounding

[p]The [code][Integer][/code] tag now rounds decimal values to the nearest integer. In Lasso Professional 5 the [code][Integer][/code] tag instead truncated decimal values to the next lowest integer. The new process yields a more accurate result. In general, no changes to existing sites should be necessary. [/p]

To update existing sites:

[p]Use the [code][Math_Floor][/code] tag to return the next lowest integer rather than using the [code][Integer][/code] tag. [/p]

No Records Found

[p]The [code][Error_NoRecordsFound][/code] tag has been deprecated. This tag will continue to work with the Lasso Connector for FileMaker Pro, but may not work with MySQL databases or with third party data source connectors. [/p]

To update existing sites:

[p]Change any code which uses [code][Error_NoRecordsFound][/code] to instead check whether [code][Found_Count] [/code]is equal to zero. For example, the following code from Lasso 5: [/p]

[pre][If: (Error_CurrentError) == (Error_NoRecordsFound)]
No records were found!
[/If] [/pre]

[p]Can be written as follows in Lasso 7: [/p]

[pre][If: (Found_Count) == 0]
No records were found!
[/If] [/pre]

Lasso MySQL

[p]A number of changes have been made to the Lasso Connector for Lasso MySQL in order to make its behavior match that of the Lasso Connector for FileMaker Pro. These changes will not in general require any changes to existing Lasso Professional 5 sites. [/p]

Table 5: Lasso MySQL Syntax Changes

[table][tr][th]Syntax Change[/th][th]Description[/th][th] [/th][/tr]

[tr][td]-Add and -Update[/td][td]The -Add and -Update actions now return the record which was just added to the database or updated within the database by default. [/td][/tr]

[tr][td]Full Text Searching[/td][td]The ft operator allows full text indices to be searched. Lasso Administration allows full text indices to be created. [/td][/tr]

[tr][td]Random Sorting[/td][td]The -SortRandom keyword can be used to return MySQL results in random order. [/td][/tr]

[tr][td]Regular Expression Searching[/td][td]The rx and nrx operators allow regular expression searches to be performed and all records which match or do not match the results to be returned. [/td][/tr]

[tr][td]Searching for Distinct Values[/td][td]The -Distinct keyword allows only distinct records from search results to be returned. [/td][/tr]

[tr][td]Searching for Null Values[/td][td]The inline tag now recognizes Null as a value distinct from the empty string allowing Null values in databases to be found. [/td][/tr]

[tr][td]Using LIMIT Options[/td][td]The -UseLimit keyword instructs Lasso to use LIMIT options to select the found records to show rather than using native methods. This can result in better performance on large databases with large found sets.[/td][td] [/td][/tr]

[tr][td]Value Lists[/td][td]Values lists are now supported for ENUM and SET data types within MySQL databases. [/td][/tr]

[/table]

[p]See the MySQL Data Sources for complete documentation of these changes. [/p]